class Schedule < ActiveRecord::Base


#validation for the games opponent has to exist
validates_presence_of :opponent

#find and show home games
def self.home_games
	find(:all, :conditions => "game_date >= CURRENT_TIMESTAMP() AND game_type = 'home'", 
		   :order      => "game_date")
end
#find and show away games
def self.away_games
	find(:all, :conditions => "game_date >= CURRENT_TIMESTAMP() AND game_type = 'away'",
		   :order      => "game_date")
end





#format date to look like a name
def name
 game_date.to_s(:long)
end
# for the game location
def type
 game_type
end

end
